package com.simplenix.nicasio.misc;

import java.io.FileNotFoundException;
import java.io.IOException;

/**
 *
 * @author fronald
 */
public class AppConfiguration {

	private static AppConfiguration cf = null;

	private PropertiesReader pr = null;

	public static final String DEFAULT_LANGUAGE = "default.language";

	public static final String APP_TITLE = "app.title";

	public static final String APP_LOGO = "app.logo";

	public static final String CSS = "css";

	public static AppConfiguration getInstance() throws FileNotFoundException, IOException {
		if (cf == null) {
			cf = new AppConfiguration();
		}
		return cf;
	}

	private AppConfiguration() throws FileNotFoundException, IOException {
		this.pr = new PropertiesReader("WEB-INF/config/application.properties");
	}

	public String getDefaultLanguage() {
		return this.pr.getProperty(DEFAULT_LANGUAGE);
	}

	public String getAppTitle() {
		return this.pr.getProperty(APP_TITLE);
	}

	public String getAppLogo() {
		return this.pr.getProperty(APP_LOGO);
	}

	public String getCss() {
		return this.pr.getProperty(CSS);
	}

	public String getKey(String configKey) {
		return this.pr.getProperty(configKey);
	}

}
